<?php
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use yii\helpers\Html;
use common\components\helpers\Fun;
LayerConfirmWidget::widget();
LayerIframeWidget::widget();

?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
    <?= $this->renderFile('@app/views/layouts/toolbar.php'); ?>
    <div id="search-area" class="yx-bgf7f7f7 yx-radius5 zx-mg yx-function2 yx-pr0">
        <?= Html::beginForm(Fun::url(['coupons/index']), 'get', ['enctype' => 'multipart/form-data']) ?>
        <?= \common\components\helpers\Search::textInput('name', null, ['label' => '券名', 'class' => 'search  yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::textInput('total', null, ['label' => '额度', 'class' => 'search  yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::dropDownList('type', null, [null => '请选择', 'discount' => '折扣券', 'full' => '满减券', 'freight' => '运费券'], ['label' => '类型', 'promote' => '请选择', 'class' => 'search diy_select_txt']) ?>
        <?= \common\components\helpers\Search::submitButton('搜索', ['id' => 'search-handle', 'class' => "yx-search yx-radius2"]); ?>
        <?php Html::endForm() ?>
    </div>
    <div class="docs-main zx-mg">
        <table id="tablesaw" class="tablesaw table yx-table1 yx-table3 table-striped with-check"
               data-tablesaw-mode="swipe" data-tablesaw-minimap>
            <thead>
            <tr class="yx-bgd2f6ec">
                <th><?= \Yii::t('zhtfrontend', 'ID'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '名称'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '类型'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '券金额'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '使用额度'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '数量'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '开始时间'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '结束时间'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '领取数量'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '创建时间'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '操作'); ?></th>
            </tr>
            </thead>
            <?php if ($data): ?>
                <?php foreach ($data as $item): ?>
                    <tr data-id="<?= $item['id'] ?>">
                        <td><?= $item['id'] ?></td>
                        <td><?= $item['name'] ?></td>
                        <td><?= $item['type'] ?></td>
                        <td><?= $item['amount'] ?></td>
                        <td><?= $item['total'] ?></td>
                        <td><?= $item['quantity'] ?></td>
                        <td><?= $item['start_time'] ?></td>
                        <td><?= $item['end_time'] ?></td>
                        <td><?= $item['issue_qty'] ?></td>
                        <td><?= $item['created_at'] ?></td>
                        <td><?= $item['operate'] ?></td>
                    </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </table>
        <div style="text-align: right"><?= common\components\widgets\GoPager::widget(['pagination' => $pages]) ?></div>
    </div>
</div>

